home *** CD-ROM | disk | FTP | other *** search
/ Freelog 119 / FreelogNo119-MarsAvril2014.iso / Securite / Malwarebytes Anti-Malware / mbam-setup-1.75.0.1300.exe / {app} / Chameleon / chameleon.chm / js / getchmpath.js next >
Text File  |  2012-03-03  |  569b  |  25 lines

  1. // http://helpware.net/FAR/far_faq.htm#Script_to_External_File
  2.  
  3. function GetChmPath() {
  4.     
  5.     var X, Y, a, ra, dir;
  6.     ra = /::/;
  7.     a = location.href.search(ra);
  8.     if (a <= 0)  return "";
  9.     
  10.     //find the index of the first colon in the string
  11.     X = 0;
  12.     ra = /:/;
  13.     a = location.href.search(ra);
  14.     if (a == 2) X = 14; //prefix = mk:@MSITStore:
  15.     else 
  16.     if (a > 2) X = a+1; //prefix = ms-its: OR prefix = its:
  17.     
  18.     Y = location.href.lastIndexOf( "\\" );
  19.     dir = location.href.substring(X, Y);
  20.     
  21.     return unescape(dir) + "\\";
  22.     
  23. }
  24.  
  25.